package com.beamfield.dao.process;

import com.beamfield.model.Process;
import com.beamfield.modelVo.MaterialStraceVo;
import com.beamfield.modelVo.ProcNoticeWithDetailVo;
import com.beamfield.modelVo.ProcessVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface ProcessMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Process record);

    int insertSelective(Process record);

    Process selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Process record);

    int updateByPrimaryKey(Process record);

    ProcessVo selectByNoticeIdAndStep(@Param("noticeId") String noticeId, @Param("step") String step);

    int deleteByNoticeId(@Param("noticeId") String noticeId, @Param("step") String step);

    Integer selectConsumeTime(@Param("noticeId") Long noticeId);

    List<Process> selectByNoticeId(@Param("noticeId") String noticeId);

    int  countByStepAndDado(@Param("stepList") List<Integer> stepList, @Param("dado") String dado, @Param("noticeId") String noticeId,@Param("beamId") Long beamId);

    List<MaterialStraceVo> selectSuppliesTrace(@Param("projectDetailId") String projectDetailId,@Param("offset") String offset, @Param("limit") String limit);

    long countSuppliesTrace(@Param("projectDetailId") String projectDetailId);

   Process selectNoticeIdListByDado(@Param("dado") String dado,@Param("beamId") Long beamId);


    ProcNoticeWithDetailVo selectProcNoticeWithDetailVoByDado(@Param("noticeId")String noticeId, @Param("beam_id")String beamId);

    Process selectByNoticeIdAndDado(@Param("noticeId") String noticeId,@Param("dado") String dado,@Param("beamId")Long beamId);

    int countByStepAndDado$ZLTZ(@Param("stepList") List<Integer> stepList, @Param("dado") String dado, @Param("noticeId") String noticeId,@Param("beamId") Long beamId);

    int countByDado(@Param("beamId") Long beamId,@Param("dado") String dado);
}
